class Team < ActiveRecord::Base
  has_many    :maintenance
  has_many    :standardMaintenance
  has_many    :work
  has_many    :worker
  belongs_to  :leader, :class_name=>"Worker", :foreign_key=>"worker_id"
  has_many    :managers, :class_name => "Worker",:foreign_key => "team_id",:conditions => {:is_manager => 1}

  attr_accessor :manager_name
  
  def self.findPage offset,limit
    find(:all,:offset => offset,:limit => limit,:order => "is_locked")
  end

end
